package com.china.produce.message;

import org.springframework.data.redis.core.StringRedisTemplate;

/**
 * @ClassName
 * @Author niujie
 * @Version
 * @Description
 * @CreateTime 2025/6/24
 */
public class RedisMessageDistributor implements MessageDistributor{

    private final StringRedisTemplate redisTemplate;

    public RedisMessageDistributor(StringRedisTemplate redisTemplate) {
        this.redisTemplate = redisTemplate;
    }

    @Override
    public void distribute(String channel, String message) {
        redisTemplate.convertAndSend(channel, message);
    }
}
